# 列表推导
list1 = [i**2 for i in range(10)] # 从0到9的平方
print(list1)

# with语法
with open('test.txt', 'w') as f: # 创建文件
    f.write('hello world')

# 函数解包
def fun(a, b, c):
    print(a, b, c)

list = [1, 2, 3]
fun(*list) # 列表解包,分别赋值为函数的3个参数
